/**
 * Words. 
 * 
 * The text() function is used for writing words to the screen. 
 */

import processing.serial.*;
int x = 30;
PFont fontA;
int n = 0;
String[] ports;

void setup() 
{
  size(200, 400);
  background(102);




  // Load the font. Fonts must be placed within the data 
  // directory of your sketch. Use Tools > Create Font 
  // to create a distributable bitmap font. 
  // For vector fonts, use the createFont() function. 
  fontA = loadFont("Ziggurat-HTF-Black-32.vlw");

  // Set the font and its size (in units of pixels)
  textFont(fontA, 32);

  // Only draw once
}


void draw() {
  // get list of serial ports
  ports = Serial.list();

  fill(90);
  rect(0, 0, 200, 400);
  // display them one by one
  for (n = 0; n < ports.length; n++) {
    println(ports[n]);
    fill((n * 60) % 255);
    text(ports[n], x, (n+1) * 60);
  }
  delay(2000); 
}



